package Util::Email::SendEmail;
use Moose;
use namespace::autoclean;
use String::Random;
use MIME::Lite::TT::HTML;

#####################################################
#Input: 
#	email	
#	username	
#	user	
#####################################################
sub send {
	my ($self, $email, $title, $template, $params, $options) = @_;

        my $msg = MIME::Lite::TT::HTML->new(
		From        =>  '随你团 <noreply@suinituan.com>',
		To          =>  "$email",
		'Reply-to'  =>  'noreply@suinituan.com',
		Subject     =>  "$title",      
		Encoding    => 'base64',
		Template    =>  {
			html    =>  "$template",
		},
		Charset     => 'utf8',
		TmplOptions =>  $options,
		TmplParams  =>  $params,
	);

        $msg->send;

}

__PACKAGE__->meta->make_immutable;

1;
